package gameObject.item;

import gameObject.effect.BulletEffect;
import gameObject.effect.SwordEffect;
import main.Res;
import base.ItemFrame;

public class ItemHammer extends ItemArm{

	protected ItemHammer(int id, String name, int cost, int dam, int range,
			int delay) {
		super(id, name, cost, dam, range, delay);
		frameSequence = new ItemFrame[7];
		frameSequence[0] = new ItemFrame(12,3,0,0);
		frameSequence[1] = new ItemFrame(13,5,60,0);
		frameSequence[2] = new ItemFrame(13,-5,30,0);
		frameSequence[3] = new ItemFrame(6,-10,300,0,true);
		frameSequence[4] = new ItemFrame(4,-12,300,0);
		frameSequence[5] = new ItemFrame(6,-10,300,0);
		frameSequence[6] = new ItemFrame(10,3,30,0);
		
		sprite = Res.createArm1Sprite(id-5);
		sprite.defineReferencePixel(10, 20);
	}

	public BulletEffect createEffect() {
		int l = range-10;
		BulletEffect eff = new SwordEffect(getId()-5,owner.getX(),owner.getY(), targetX,targetY,
				getDamage(),l*10/3,3);
		eff.moveTo(targetX,targetY, 10);
		return eff;
	}
}
